<template>
  <div class="container">
    <el-container>
      <el-header class="header">
        <el-carousel :interval="5000" arrow="always" height="600px" class="carousel" ref="carousel">
          <el-carousel-item v-for="(image,index) in images" :key="index">
            <div class="carousel-content">
              <img :src="image.url" alt="轮播图" class="carousel-image"/>
              <div class="carousel-overlay"></div>
              <div class="carousel-info">
                <span class="carousel-tag">{{ image.tag }}</span>
                <h2 class="carousel-title">{{ image.title }}</h2>
                <p class="carousel-desc">{{ image.desc }}</p>
                <div class="carousel-buttons">
                  <button class="watch-btn primary" @click="goToDramaDetail(image.id, image.name)">
                    <i class="fas fa-play"></i>
                    立即观看
                  </button>
                  <button class="watch-btn secondary" @click="goToDramaDetail(image.id, image.name)">
                    <i class="fas fa-info-circle"></i>
                    详情
                  </button>
                </div>
              </div>
            </div>
          </el-carousel-item>
        </el-carousel>
      </el-header>
      
      <el-main class="main-content">
        <!-- 推荐热门区域 -->
        <section class="section">
          <h2 class="section-title">推荐热门</h2>
          <div class="drama-grid">
            <div v-for="(drama, index) in shortDramas" :key="index" 
                 class="drama-card" 
                 @click="goToDramaDetail(drama.detailsId,drama.name)">
              <div class="drama-tag">{{ drama.tag || 'NEW' }}</div>
              <div class="image-wrapper">
                <img :src="drama.cover" :alt="drama.name" class="drama-image">
                <div class="play-button">
                  <i class="fas fa-play"></i>
                </div>
              </div>
              <div class="drama-info">
                <h3 class="drama-title">{{ drama.name }}</h3>
                <p class="drama-category">{{ drama.classify }}</p>
                <div class="drama-rating">
                  <i class="fas fa-star rating-star"></i>
                  <span class="rating-number">{{ (Math.random() * 2 + 8).toFixed(1) }}</span>
                </div>
                <div class="drama-views">
                  <i class="fas fa-eye"></i>
                  <span>{{ Math.floor(Math.random() * 100) }}万播放</span>
                </div>
              </div>
            </div>
          </div>
        </section>

        <!-- 电影区域 -->
        <section class="section">
          <div class="section-header">
            <h2 class="section-title">电影</h2>
            <a href="/counterattack" class="view-more">查看更多</a>
          </div>
          <div class="drama-grid">
            <div v-for="(drama, index) in MovieDramas" :key="index" 
                 class="drama-card" 
                 @click="goToDramaDetail(drama.detailsId,drama.name)">
              <div class="drama-tag">{{ drama.tag || 'NEW' }}</div>
              <div class="image-wrapper">
                <img :src="drama.cover" :alt="drama.name" class="drama-image">
                <div class="play-button">
                  <i class="fas fa-play"></i>
                </div>
              </div>
              <div class="drama-info">
                <h3 class="drama-title">{{ drama.name }}</h3>
                <p class="drama-category">{{ drama.classify }}</p>
                <div class="drama-rating">
                  <i class="fas fa-star rating-star"></i>
                  <span class="rating-number">{{ (Math.random() * 2 + 8).toFixed(1) }}</span>
                </div>
                <div class="drama-views">
                  <i class="fas fa-eye"></i>
                  <span>{{ Math.floor(Math.random() * 100) }}万播放</span>
                </div>
              </div>
            </div>
          </div>
        </section>

        <!-- 电视剧区域 -->
        <section class="section">
          <div class="section-header">
            <h2 class="section-title">电视剧</h2>
            <a href="/sweet" class="view-more">查看更多</a>
          </div>
          <div class="drama-grid">
            <div v-for="(drama, index) in TeleplayDramas" :key="index" 
                 class="drama-card" 
                 @click="goToDramaDetail(drama.detailsId,drama.name)">
              <div class="drama-tag">{{ drama.tag || 'NEW' }}</div>
              <div class="image-wrapper">
                <img :src="drama.cover" :alt="drama.name" class="drama-image">
                <div class="play-button">
                  <i class="fas fa-play"></i>
                </div>
              </div>
              <div class="drama-info">
                <h3 class="drama-title">{{ drama.name }}</h3>
                <p class="drama-category">{{ drama.classify }}</p>
                <div class="drama-rating">
                  <i class="fas fa-star rating-star"></i>
                  <span class="rating-number">{{ (Math.random() * 2 + 8).toFixed(1) }}</span>
                </div>
                <div class="drama-views">
                  <i class="fas fa-eye"></i>
                  <span>{{ Math.floor(Math.random() * 100) }}万播放</span>
                </div>
              </div>
            </div>
          </div>
        </section>

        <!-- 综艺区域 -->
        <section class="section">
          <div class="section-header">
            <h2 class="section-title">综艺</h2>
            <a href="/Variety" class="view-more">查看更多</a>
          </div>
          <div class="drama-grid">
            <div v-for="(drama, index) in VarietyDramas" :key="index" 
                 class="drama-card" 
                 @click="goToDramaDetail(drama.detailsId,drama.name)">
              <div class="drama-tag">{{ drama.tag || 'NEW' }}</div>
              <div class="image-wrapper">
                <img :src="drama.cover" :alt="drama.name" class="drama-image">
                <div class="play-button">
                  <i class="fas fa-play"></i>
                </div>
              </div>
              <div class="drama-info">
                <h3 class="drama-title">{{ drama.name }}</h3>
                <p class="drama-category">{{ drama.classify }}</p>
                <div class="drama-rating">
                  <i class="fas fa-star rating-star"></i>
                  <span class="rating-number">{{ (Math.random() * 2 + 8).toFixed(1) }}</span>
                </div>
                <div class="drama-views">
                  <i class="fas fa-eye"></i>
                  <span>{{ Math.floor(Math.random() * 100) }}万播放</span>
                </div>
              </div>
            </div>
          </div>
        </section>

        <!-- 动漫区域 -->
        <section class="section">
          <div class="section-header">
            <h2 class="section-title">动漫</h2>
            <a href="/rebirth" class="view-more">查看更多</a>
          </div>
          <div class="drama-grid">
            <div v-for="(drama, index) in AnimationDramas" :key="index" 
                 class="drama-card" 
                 @click="goToDramaDetail(drama.detailsId,drama.name)">
              <div class="drama-tag">{{ drama.tag || 'NEW' }}</div>
              <div class="image-wrapper">
                <img :src="drama.cover" :alt="drama.name" class="drama-image">
                <div class="play-button">
                  <i class="fas fa-play"></i>
                </div>
              </div>
              <div class="drama-info">
                <h3 class="drama-title">{{ drama.name }}</h3>
                <p class="drama-category">{{ drama.classify }}</p>
                <div class="drama-rating">
                  <i class="fas fa-star rating-star"></i>
                  <span class="rating-number">{{ (Math.random() * 2 + 8).toFixed(1) }}</span>
                </div>
                <div class="drama-views">
                  <i class="fas fa-eye"></i>
                  <span>{{ Math.floor(Math.random() * 100) }}万播放</span>
                </div>
              </div>
            </div>
          </div>
        </section>

        <!-- 逆袭区域 -->
        <section class="section">
          <div class="content-wrapper">
            <div class="left-content">
              <h2 class="section-title">逆袭</h2>
              <div class="drama-grid-large">
                <div v-for="(drama, index) in VideoData" :key="index" 
                     class="drama-card-large" 
                     @click="goToDramaDetail(drama.detailsId,drama.name)">
                  <div class="drama-tag">{{ drama.tag || 'NEW' }}</div>
                  <div class="image-wrapper">
                    <img :src="drama.cover" :alt="drama.name" class="drama-image">
                    <div class="play-button">
                      <i class="fas fa-play"></i>
                    </div>
                  </div>
                  <div class="drama-info">
                    <h3 class="drama-title">{{ drama.name }}</h3>
                    <p class="drama-category">{{ drama.classify }}</p>
                    <div class="drama-rating">
                      <i class="fas fa-star rating-star"></i>
                      <span class="rating-number">{{ (Math.random() * 2 + 8).toFixed(1) }}</span>
                    </div>
                    <div class="drama-views">
                      <i class="fas fa-eye"></i>
                      <span>{{ Math.floor(Math.random() * 100) }}万播放</span>
                    </div>
                  </div>
                </div>
              </div>
            </div>

            <!-- 排行榜 -->
            <div class="ranking-section">
              <el-card class="ranking-card">
                <h2 class="ranking-title">周排行榜</h2>
                <div class="ranking-list">
                  <!-- 第一名 -->
                  <div v-if="loadFindTop10Details.length > 0" 
                       class="ranking-item ranking-first" 
                       @click="gotoloadFindTop10(loadFindTop10Details[0].name,loadFindTop10Details[0].detailsId)">
                    <span class="rank-number rank-1">1</span>
                    <img :src="loadFindTop10Details[0].cover" :alt="loadFindTop10Details[0].name" class="rank-image">
                    <span class="rank-title">{{ truncateString(loadFindTop10Details[0].name,10) }}</span>
                  </div>
                  <!-- 其他排名 -->
                  <div v-for="(drama, index) in loadFindTop10Details.slice(1)" 
                       :key="index"
                       class="ranking-item"
                       @click="gotoloadFindTop10(drama.name,drama.detailsId)">
                    <span class="rank-number" :class="'rank-' + (index + 2)">{{ index + 2 }}</span>
                    <span class="rank-title">{{ truncateString(drama.name,10) }}</span>
                  </div>
                </div>
              </el-card>
            </div>
          </div>
        </section>
      </el-main>
    </el-container>
  </div>
</template>

<script setup>
import { ref,onMounted } from 'vue';
import request from "@/utils/request";
import { useRouter } from 'vue-router';
import '@fortawesome/fontawesome-free/css/all.css'; // 在 JavaScript 文件中引入
const loadFindTop10Details=ref([])
const sort=ref('推荐热门')
const userName=localStorage.getItem('userName')
  const indicate=ref('/')
// Reactive data for short dramas
const shortDramas = ref([]);
const VideoData = ref([]);
const MovieDramas=ref('');
const TeleplayDramas=ref('');
const VarietyDramas=ref('');
const AnimationDramas=ref('');
const images = ref([
  {
    url: require('@/assets/carousel/banner1.jpg'),
    title: '狩猎',
    desc: '曹卫宇 、 喻亢主演悬疑动作大片',
    tag: '热播',
    id: '1',
    name: '狩猎'
  },
  {
    url: require('@/assets/carousel/banner2.jpg'),
    title: '满江红',
    desc: '沈腾、易烊千玺演绎悬疑巨作',
    tag: '独播',
    id: '2',
    name: '满江红'
  },
  {
    url: require('@/assets/carousel/banner3.jpg'),
    title: '叶问2',
    desc: '甄子丹 、 洪金宝演绎宗师传奇',
    tag: '特别推荐',
    id: '3',
    name: '叶问'
  }
]);
// Method to fetch short drama data asynchronously
//推荐热门
const loadShortDramas = async (classify) => {
  try {
    // Fetch short drama data
    const res = await request.get('/details/selectTop10', { params: { classify: classify } });
    // If successful, update the short drama data
    shortDramas.value = res.data.data;
    console.log("====",shortDramas.value)
  } catch (error) {
    // Catch and handle errors
    console.error('Error loading short dramas:', error);
  }
};
//电影
const loadMovieDramas=async()=>{
  try{
    const res=await request.get('/details/selectTop12');
    MovieDramas.value=res.data.data;
  }catch(error){
    console.error('Error loading short dramas:', error);
  }
}
//电视剧
const loadTeleplayDramas=async()=>{
  try{
    const res=await request.get('/details/selectTeleplay');
    TeleplayDramas.value=res.data.data;
  }catch(error){
    console.error('Error loading short dramas:', error);
  }
}

//综艺
const loadVarietyDramas=async()=>{
  try{
    const res=await request.get('/details/selectVariety');
    VarietyDramas.value=res.data.data;
  }catch(error){
    console.error('Error loading short dramas:', error);
  }
}
//动漫
const loadAnimationDramas=async()=>{
  try{
    const res=await request.get('/details/selectAnimation');
    AnimationDramas.value=res.data.data;
  }catch(error){
    console.error('Error loading short dramas:', error);
  }
}
const loadVideoData = async (classify) => {
  try {
    // Fetch short drama data
    const res = await request.get('/details/selectTopSix', { params: { classify: classify } });
    // If successful, update the short drama data
    VideoData.value = res.data.data;
    console.log("====",VideoData.value)
  } catch (error) {
    // Catch and handle errors
    console.error('Error loading short dramas:', error);
  }
};
loadShortDramas("重生");
loadVideoData("逆袭")

// Router instance
const router = useRouter();

// Method to navigate to drama detail page
const goToDramaDetail = (dramaId,name) => {
  request.post(`/news/click/${dramaId}`)
  request.post('/news/click/',{
    id: dramaId,
    username: userName
  })
  console.log(userName);
  // Navigate to the detail page and pass drama ID as route parameter
  router.push({ name: 'VideoStory', params: { id: dramaId ,name: name,sort: sort.value,indicate: indicate.value} });
  
};
const gotoloadFindTop10 =(name,detailsId) =>{
  request.post(`/news/click/${detailsId}`)
  request.post('/news/click/',{
    id: detailsId,
    username: userName
  })
  console.log("/////",detailsId);
  router.push({name: 'VideoStory',params: {id: detailsId,name:name,sort: sort.value,indicate: indicate.value}})
}
const loadFindTop10 =async()=>{
  const  res=await request.get('/news/top10')
  loadFindTop10Details.value=res.data.data
  console.log("===loadFindTop10Details===",res.data.data); 
}

//限制字数
const truncateString = (str, maxLength) => {
  if (!str) return "";
  if (str.length <= maxLength) {
    return str;
  } else {
    return str.slice(0, maxLength) + "...";
  }
};
onMounted(()=>{
  loadFindTop10();
  loadMovieDramas();
  loadTeleplayDramas();
  loadVarietyDramas();
  loadAnimationDramas();
});
</script>

<style scoped>
.container {
  min-height: 100%;
  background-color: #141414;
  color: #fff;
  padding-bottom: 50px;
  position: relative;
  overflow: hidden;
}

/* 添加背景动画效果 */
.container::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(255, 107, 107, 0.1), transparent 70%),
              radial-gradient(circle at bottom left, rgba(255, 146, 43, 0.1), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.header {
  padding: 0;
  margin-bottom: 40px;
  height: 600px !important;
  position: relative;
}

/* 轮播图渐变遮罩 */
.carousel::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px;
  background: linear-gradient(to bottom, transparent, #141414);
}

.carousel {
  width: 100%;
  height: 600px;
  position: relative;
}

.carousel-content {
  position: relative;
  height: 100%;
  overflow: hidden;
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  transition: transform 0.6s ease-out;
}

.el-carousel__item:hover .carousel-image {
  transform: scale(1);
}

.carousel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.4) 50%,
    rgba(0, 0, 0, 0.2) 100%
  );
}

.carousel-info {
  position: absolute;
  left: 10%;
  bottom: 20%;
  max-width: 600px;
  z-index: 2;
  transform: translateY(30px);
  opacity: 0;
  transition: all 0.6s ease-out;
  pointer-events: auto;
}

.el-carousel__item.is-active .carousel-info {
  transform: translateY(0);
  opacity: 1;
}

.carousel-tag {
  display: inline-block;
  padding: 6px 12px;
  background: linear-gradient(45deg, #ff6b6b, #ff922b);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.6s ease-out 0.2s;
}

.el-carousel__item.is-active .carousel-tag {
  transform: translateY(0);
  opacity: 1;
}

.carousel-title {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.6s ease-out 0.3s;
}

.el-carousel__item.is-active .carousel-title {
  transform: translateY(0);
  opacity: 1;
}

.carousel-desc {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 30px;
  opacity: 0.9;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.6s ease-out 0.4s;
}

.el-carousel__item.is-active .carousel-desc {
  transform: translateY(0);
  opacity: 0.9;
}

.carousel-buttons {
  display: flex;
  gap: 16px;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.6s ease-out 0.5s;
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.el-carousel__item.is-active .carousel-buttons {
  transform: translateY(0);
  opacity: 1;
}

.watch-btn {
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  pointer-events: auto;
}

.watch-btn.primary {
  background: linear-gradient(45deg, #ff6b6b, #ff922b);
  color: white;
}

.watch-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  backdrop-filter: blur(10px);
}

.watch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.watch-btn.primary:hover {
  background: linear-gradient(45deg, #ff922b, #ff6b6b);
}

.watch-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 轮播图指示器样式优化 */
.carousel-indicators {
  position: absolute;
  bottom: 40px;
  left: 10%;
  transform: translateX(0);
  display: flex;
  gap: 12px;
  z-index: 3;
}

.indicator {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.indicator::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #ff6b6b, #ff922b);
  transform: translateX(-100%);
  transition: transform 5s linear;
}

.indicator.active::after {
  transform: translateX(0);
}

/* 自定义轮播图箭头 */
:deep(.el-carousel__arrow) {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  transition: all 0.3s;
}

:deep(.el-carousel__arrow:hover) {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

:deep(.el-carousel__arrow--left) {
  left: 40px;
}

:deep(.el-carousel__arrow--right) {
  right: 40px;
}

.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  margin-top: 120px;
  position: relative;
}

.section {
  margin-bottom: 60px;
  position: relative;
}

/* 分类标题动画效果 */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-left: 15px;
  position: relative;
}

.section-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: linear-gradient(to bottom, #ff6b6b, #ff922b);
  border-radius: 2px;
}

.section-title {
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  margin: 0;
  position: relative;
  padding-left: 15px;
  margin-bottom: 30px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: linear-gradient(to bottom, #ff6b6b, #ff922b);
  border-radius: 2px;
}

.view-more {
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  opacity: 0.7;
  transition: all 0.3s;
  padding: 6px 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.1);
}

.view-more:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.2);
}

.drama-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.drama-grid-large {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.drama-card {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  transition: all 0.3s;
  cursor: pointer;
}

.drama-card-large {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  transition: all 0.3s;
  cursor: pointer;
}

.drama-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(45deg, #ff6b6b, #ff922b);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  color: white;
  z-index: 3;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.image-wrapper {
  position: relative;
  width: 100%;
  padding-top: 140%;
  border-radius: 12px;
  overflow: hidden;
  background-color: #2a2a2a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.drama-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.drama-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
}

.drama-card:hover .drama-info,
.drama-card-large:hover .drama-info {
  transform: translateY(0);
}

.drama-card:hover .drama-image,
.drama-card-large:hover .drama-image {
  transform: scale(1.1);
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(45deg, #ff6b6b, #ff922b);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: all 0.3s;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.drama-card:hover .play-button,
.drama-card-large:hover .play-button {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.drama-title {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 8px 0;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drama-category {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.drama-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

.rating-star {
  color: #ffd700;
}

.rating-number {
  color: #fff;
  font-size: 14px;
}

.drama-views {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  gap: 4px;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 30px;
  align-items: start;
}

.ranking-card {
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  position: sticky;
  top: 20px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s;
}

.ranking-card:hover {
  transform: translateY(-5px);
}

.ranking-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #fff;
  position: relative;
  padding-left: 15px;
}

.ranking-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: linear-gradient(to bottom, #ff6b6b, #ff922b);
  border-radius: 2px;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  background: rgba(255, 255, 255, 0.05);
}

.ranking-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.ranking-first {
  padding: 16px;
  margin-bottom: 16px;
  background: linear-gradient(45deg, rgba(255, 107, 107, 0.1), rgba(255, 146, 43, 0.1));
}

.rank-number {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  margin-right: 12px;
  font-weight: 600;
  transition: transform 0.3s;
}

.ranking-item:hover .rank-number {
  transform: scale(1.1);
}

.rank-1 {
  background: linear-gradient(45deg, #ff6b6b, #ff922b);
  color: #fff;
}

.rank-2 {
  background: linear-gradient(45deg, #ff922b, #ffd43b);
  color: #fff;
}

.rank-3 {
  background: linear-gradient(45deg, #ffd43b, #fff3bf);
  color: #fff;
}

.rank-image {
  width: 120px;
  height: 160px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 12px;
  transition: transform 0.3s;
}

.ranking-first:hover .rank-image {
  transform: scale(1.05);
}

.rank-title {
  flex: 1;
  font-size: 14px;
  color: #fff;
  transition: color 0.3s;
}

.ranking-item:hover .rank-title {
  color: #ff6b6b;
}

:deep(.el-card__body) {
  padding: 20px;
}

/* 响应式布局 */
@media screen and (max-width: 1400px) {
  .drama-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  
  .drama-grid-large {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 1200px) {
  .drama-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .drama-grid-large {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 992px) {
  .drama-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .drama-grid-large {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .drama-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .drama-grid-large {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 480px) {
  .drama-grid,
  .drama-grid-large {
    grid-template-columns: 1fr;
  }
}

/* 添加滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #ff6b6b, #ff922b);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #ff922b, #ff6b6b);
}
</style>
